import axios from 'axios'

export default {
  // async getUser () {
  //   let result = await axios({
  //     url: '/api/admin/getUser',
  //     method: 'get'
  //   })
  //   return result
  // },
  async getFactory () {
    // 获取承接工厂
    let result = await axios({
      url: '/api/order/getFactory',
      method: 'get'
    })
    return result
  },
  async getWarehouse () {
    // 获取仓库
    let result = await axios({
      url: '/api/order/getWarehouse',
      method: 'get'
    })
    return result
  },
  async search ( index ) {
    // 获取搜索结果
    let result = await axios({
      url: '/api/order/getCommoditySearchResult/' + index,
      method: 'get',
    })
    return result
  },
  async create ( data ) {
    // 获取搜索结果
    let result = await axios({
      url: '/api/order/create',
      method: 'post',
      data: data
    })
    return result
  },
   async getWord ( id ) {
      let result = await axios({
      url: '/api/order/word/'+id,
      method: 'get'
    })
     return result
  }
}
